package com.example.support.wechat.boot;

import java.util.Map;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "wechat")
public class WechatProperties {

	private Map<String, Wechat> mappings;

	public WechatProperties() {
	}

	public Map<String, Wechat> getMappings() {
		return mappings;
	}

	public void setMappings(Map<String, Wechat> mappings) {
		this.mappings = mappings;
	}

	public static class Wechat {

		private String authReturnBase;
		private Mp mp;
		private Pay pay;
		private Trade trade;

		public Wechat() {
		}

		public String getAuthReturnBase() {
			return authReturnBase;
		}

		public void setAuthReturnBase(String authReturnBase) {
			this.authReturnBase = authReturnBase;
		}

		public Mp getMp() {
			return mp;
		}

		public void setMp(Mp mp) {
			this.mp = mp;
		}

		public Pay getPay() {
			return pay;
		}

		public void setPay(Pay pay) {
			this.pay = pay;
		}

		public Trade getTrade() {
			return trade;
		}

		public void setTrade(Trade trade) {
			this.trade = trade;
		}

		public static class Mp {

			private String appId;
			private String appSecret;
			private String mpVerifyName;

			public Mp() {
			}

			public String getAppId() {
				return appId;
			}

			public void setAppId(String appId) {
				this.appId = appId;
			}

			public String getAppSecret() {
				return appSecret;
			}

			public void setAppSecret(String appSecret) {
				this.appSecret = appSecret;
			}

			public String getMpVerifyName() {
				return mpVerifyName;
			}

			public void setMpVerifyName(String mpVerifyName) {
				this.mpVerifyName = mpVerifyName;
			}

		}

		public static class Pay {

			private String mchId;
			private String key;
			private Resource cert;
			private byte[] certData;

			public Pay() {
			}

			public String getMchId() {
				return mchId;
			}

			public void setMchId(String mchId) {
				this.mchId = mchId;
			}

			public String getKey() {
				return key;
			}

			public void setKey(String key) {
				this.key = key;
			}

			public Resource getCert() {
				return cert;
			}

			public void setCert(Resource cert) {
				this.cert = cert;
			}

			public byte[] getCertData() {
				return certData;
			}

			public void setCertData(byte[] certData) {
				this.certData = certData;
			}

		}

		public static class Trade {

			private String notifyUrl;
			private String refundNotifyUrl;

			public Trade() {
			}

			public String getNotifyUrl() {
				return notifyUrl;
			}

			public void setNotifyUrl(String notifyUrl) {
				this.notifyUrl = notifyUrl;
			}

			public String getRefundNotifyUrl() {
				return refundNotifyUrl;
			}

			public void setRefundNotifyUrl(String refundNotifyUrl) {
				this.refundNotifyUrl = refundNotifyUrl;
			}

		}

	}

}
